#include <boost/url.hpp>
#include <boost/url/decode_view.hpp>
#include <boost/url/parse_query.hpp>
#include <iostream>
#include <string>
#include <system/System.h>

std::string url     = "http://127.0.0.1:4091/20240610/电子签名.png";
std::string get_url = "/20240610/%E7%94%B5%E5%AD%90%E7%AD%BE%E5%90%8D.png";
int main() {
    sys::InitConsole();
    {
        boost::urls::encoding_opts opts;
        // Set opts as needed, e.g., opts.space_to_plus = true;

        std::string encoded_url = boost::urls::encode(url, boost::urls::unreserved_chars, opts);

        std::cout << "Original URL: " << url << std::endl;
        std::cout << "Encoded URL: " << encoded_url << std::endl;
    }
    {
        std::string encoded_url = "/20240610/%E7%94%B5%E5%AD%90%E7%AD%BE%E5%90%8D.png";
        boost::urls::encoding_opts opts;
        // Set opts as needed

        std::string decoded_url;
        boost::urls::url url(get_url);
        decoded_url = url.path();

        std::cout << "Encoded URL: " << encoded_url << std::endl;
        std::cout << "Decoded URL: " << decoded_url << std::endl;
    }
    return 0;
}
